package tpoo.common.utils.passiveOperations;

import tpoo.common.dto.model.users.status.Presence;
import tpoo.common.utils.UserSession;

public class PresenceChangedOperation extends PassiveOperation {

	private Presence presence;

	public PresenceChangedOperation(Presence presence) {
		this.presence = presence;
		this.addParameter(presence);
	}

	public void setPresence(Presence presence) {
		this.presence = presence;
	}

	public Presence getPresence() {
		return presence;
	}

	@Override
	public void execute() throws Exception {
		UserSession.getInstance().getUser().setState(
				this.getPresence().toString());
	}

}
